﻿@model EM.OA.Portal.Models.UserModels
@{
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript" src="~/Scripts/page/SystemSetting/User.js"></script>

<div class="easyui-layout" fit="true">
    <div region="west" split="true" title="组织机构" style="width: 150px;">
        @*tree0*@
        <ul class="easyui-tree" id="department_tree" ></ul>
    </div>
    <div data-options="region:'center',title:'员工列表'" style="background: #fafafa; overflow: hidden;">
        @*list*@
        <table id="list" class="easyui-datagrid" toolbar="#toolbar">
        </table>
        <div id="toolbar">
            <a href="#" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="add()">增加</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="edit()">修改</a>
            <a href="#" class="easyui-linkbutton" iconcls="icon-remove" plain="true" onclick="del()">删除</a>
        </div>
    </div>
</div>

@*----------------------------Dialog--------------------------------*@
<div id="dlg" class="easyui-dialog" style="width: 500px; height: 300px; padding: 10px 20px"
    closed="true" resizable="true" modal="true" buttons="#dlg-buttons" align="center">
    <form id="fm" method="post" novalidate="novalidate">
        <table id="tblAdd">
            <tr>
                <td>
                    @Html.LabelFor(m => m.UserName)</td>
                <td>@Html.TextBoxFor(m => m.UserName, new { @class = "easyui-validatebox", @required = "true" })
                    <input type="hidden" id="UserID" name="UserID" />
                </td>
                <td>
                    @Html.LabelFor(m=>m.Password)</td>
                <td>@Html.TextBoxFor(m => m.Password, new { @class = "easyui-validatebox",@value="123456", @required = "true" })</td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(m=>m.EmployeeCode)</td>
                <td>
                    @Html.TextBoxFor(m => m.EmployeeCode, new { @class = "easyui-validatebox" })
                </td>
                <td>
                    @Html.LabelFor(m=>m.Sort)</td>
                <td>
                    <input class="easyui-numberbox" id="Sort" name="Sort" data-options="precision:0,groupSeparator:' ',decimalSeparator:','" />
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(m=>m.EmployeeName)</td>
                <td>
                    @Html.TextBoxFor(m => m.EmployeeName, new { @class = "easyui-validatebox", @required = "true" })
                </td>
                <td>
                    @Html.LabelFor(m=>m.EmployeeSex)</td>
                <td>
                    <select id="EmployeeSex" name="EmployeeSex" class="easyui-combobox" data-options="required:true,panelHeight:'auto'">
                        <option value="0" selected="selected">男</option>
                        <option value="1">女</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(m=>m.Birthday)</td>
                <td>
                    <input class="easyui-datebox" id="Birthday" name="Birthday"></input>
                </td>
                <td>
                    @Html.LabelFor(m=>m.Email)</td>
                <td>
                    <input class="easyui-validatebox" type="text" id="Email" name="Email" data-options="required:false,validType:'email'" /></td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(m=>m.RoleID)</td>
                <td>
                    <input class="easyui-validatebox" value="00000000-0000-0000-0000-000000000000" type="text" id="RoleID" name="RoleID" data-options="required:false,validType:'length[1,1000]'" /></td>
                <td>
                    @Html.LabelFor(m=>m.DepartmentID)</td>
                <td>
                    <input id="comb_DepartmentID" class="easyui-combotree"
                        data-options="url:'/Department/GetTreeList',required:true,
                        onSelect: function(rec){  
                            $('#DepartmentID').val(rec.id); }" />
                    <input id="DepartmentID" name="DepartmentID" type="hidden" />
                </td>
            </tr>
            <tr>
                <td>
                    @Html.LabelFor(m=>m.Telephone)</td>
                <td>
                    @Html.TextBoxFor(m => m.Telephone, new { @class = "easyui-validatebox" })
                </td>
                <td>
                    @Html.LabelFor(m=>m.Mobile)</td>
                <td>
                    @Html.TextBoxFor(m => m.Mobile, new { @class = "easyui-validatebox" })
                </td>
            </tr>
            <tr>
                <td>
                    <label for="Status">访问控制：</label></td>
                <td>
                    <input class="easyui-validatebox" type="text" id="Status" name="Status" value="1" data-options="validType:'length[1,200]'" /></td>
                <td>
                    @Html.LabelFor(m=>m.AttendanceConfigID)</td>
                <td>
                    <input type="hidden" id="AttendanceConfigID" name="AttendanceConfigID" />
                    <input class="easyui-combobox" id="comb_SignConfig" name="comb_SignConfig" data-options="url:'/SignConfig/GetCommboxList',
        valueField:'id',textField:'text',onSelect: function(rec){ $('#AttendanceConfigID').val(rec.id);}">  

                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center; padding-top: 10px">
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="btnSave" onclick="save()" iconcls="icon-ok">确定</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">关闭</a>
                </td>
            </tr>
        </table>
    </form>
</div>

